//#include "node.hpp"
template<class Case_type, class Class_type, class CaseExpander_func>//float (*CaseExpander)(Case_type&)>
Class_type Node<Case_type, Class_type, CaseExpander_func>::operator () (std::vector<Case_type>& cases) 
{
	//if either of our children pntrs are null we must then be an answer node. return
	// our class value. 
	if(!m_left && !m_right)
		return m_class;
	
	//create the object that'll expand the case vector.
	CaseExpander_func expander;

	
	if(CalcPred(expander(cases[m_caseIndex]), m_caseValue))
		return (*m_left)(cases);
	return (*m_right)(cases);
}


template<typename Case_type, class Class_type, class CaseExpander_func>//float (*CaseExpander)(Case_type&)>
bool Node<Case_type, Class_type,CaseExpander_func>::CalcPred(char c, float lhs, float rhs)
{
	switch(c)
	{
	case '=':
		return lhs == rhs;
	case '<':
	default:
		return rhs < lhs;
	}
}
